//
//  WPTopicDetailViewController.m
//  ZhongChouPingTai
//
//  Created by WeiPan on 16/4/7.
//  Copyright © 2016年 HuaYiSoftware. All rights reserved.
//

#import "WPTopicDetailViewController.h"

@interface WPTopicDetailViewController ()
@property (nonatomic, strong) UIWebView * webView;
- (void)initializeUserInterface; /**< 初始化用户界面 */


@end

@implementation WPTopicDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initializeUserInterface];
}
#pragma mark - init
- (void)initializeUserInterface {
    [self.view addSubview:self.webView];
}
#pragma makr - getter
- (UIWebView *)webView {
    if (!_webView) {
        _webView = ({
            UIWebView * view = [[UIWebView alloc]initWithFrame:CGRectMake(0, navBar_Fheight, SCREEN_SIZE.width, SCREEN_SIZE.height - navBar_Fheight)];
//            view.scalesPageToFit = YES;
            NSString *resourcePath = [ [NSBundle mainBundle] resourcePath];
            NSString *filePath  = [resourcePath stringByAppendingPathComponent:self.htmeName];
            NSString *htmlstring =[[NSString alloc] initWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
            [view loadHTMLString:htmlstring  baseURL:[NSURL fileURLWithPath: [[NSBundle mainBundle]  bundlePath]]];
            view;
        });
    }
    return _webView;
}
@end
